package com.example.test_app.view;

import androidx.recyclerview.widget.RecyclerView;

import java.util.List;


public class BannarLayoutManager extends RecyclerView.LayoutManager {

    @Override
    public RecyclerView.LayoutParams generateDefaultLayoutParams() {

        return new RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.MATCH_PARENT);
    }


    private int fill(RecyclerView.Recycler recycler, RecyclerView.State state, int dy) {

        detachAndScrapAttachedViews(recycler);
        int i=onLayout(recycler, state, dy);
        recycleChildren(recycler);
        return i;
    }

    private void recycleChildren(RecyclerView.Recycler recycler) {
        List<RecyclerView.ViewHolder> scrapList = recycler.getScrapList();
        for (int i = 0; i < scrapList.size(); i++) {
            RecyclerView.ViewHolder holder = scrapList.get(i);
            removeAndRecycleView(holder.itemView, recycler);
        }
    }



    private int onLayout(RecyclerView.Recycler recycler, RecyclerView.State state, int dy) {


        return 0;
    }
}
